<template>
	<view class="content">
		<view class="line">
			<view class="input-label">新密码</view>
			<view>
				<input type="safe-password" v-model="password1" class="input-field" placeholder="请输入新密码"/>
			</view>
		</view>
		<view class="line">
			<view class="input-label">新密码</view>
			<view>
				<input class="input-field" v-model="password2" type="safe-password" placeholder="请再次输入新密码"/>
			</view>
		</view>
		<view class="submit" @click="submit">提交</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				password1: '',
				password2:'',
			}
		},
		onLoad() {

		},
		methods: {
			submit(){
				if(this.password1!=this.password2){
					uni.showToast({
					 title: "两次密码不一致",
					 icon:'none',
					 duration: 3000
					});
					return false
				}
				uni.showLoading({
					title: '加载中'
				})
				this.$http('jeecg-boot/app/market/bicStoreAccount/upPwd',{
					    password:this.password1
				},'POST').then(res => {
					  uni.hideLoading();
					  if(res.success){
						  uni.showToast({
						   title: "修改完成",
						   icon:'none',
						   duration: 3000
						  });
						  uni.clearStorageSync();
						  setTimeout(function() {
						  	uni.navigateTo({
						  		url:'../index/login'
						  	})
						  }, 1000);
						 
					  }
				})
			}
            
		}
	}
</script>

<style>
	
	.submit{
		width: 650rpx;
		height: 80rpx;
		line-height: 80rpx;
		text-align: center;
		background: #3F90F7;
		color: #ffffff;
		font-size: 30rpx;
		border-radius: 10rpx;
		position: fixed;
		bottom: 100rpx;
		left: 50rpx;
	}
	.line{
		display: flex;
		padding: 30rpx 20rpx;
		border-bottom: 1px solid #eee;
		color: #333333;
	}
	.input-field{
		padding-left: 50rpx;
	}
</style>
